﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WumpusTest
{
    /// <summary>
    /// Contains a network of planets.  The planets themselves contain 
    /// information about their neighbors.
    /// </summary>
    public class Connections
    {
        public Connections(LinkedList<Planet> planets) 
        { 
            this.Planets = planets; 
        }
        
        /// <summary>
        /// Gets the shortest path between two planets.
        /// </summary>
        /// 
        /// <param name="start">
        /// The planet to start searching from.
        /// </param>
        /// 
        /// <param name="end">
        /// The planet to target.
        /// </param>
        /// 
        /// <returns>
        /// Returns a linked list of the planets along the 
        /// shortest path, from start to finish
        /// </returns>
        public LinkedList<Planet> GetShortestPath(ref Planet start, ref Planet end)
        {
            LinkedList<Planet> linkedList = new LinkedList<Planet>();
            return linkedList;
        }

        protected LinkedList<Planet> Planets;
    }

    public class Coordinates
    {
        public Coordinates() :
            this(0, 0)
        {
            // empty
        }

        public Coordinates(float x, float y, float mass = 1)
        {
            this.X = x;
            this.Y = y;
            this.Mass = mass;
        }

        public float Mass;

        private float m_X = 0;
        public float X
        {
            get { return m_X; }
            set { m_X = value; }
        }

        private float m_Y = 0;
        public float Y
        {
            get { return m_Y; }
            set { m_Y = value; }
        }
    }

    public class Planet
    {
        public Planet(PlanetGraphics graphics, List<Planet> neighbors)
        {
            this.Graphics = graphics;
            this.Neighbors = neighbors;
        }
        
        public PlanetGraphics Graphics;
        public List<Planet> Neighbors;
    }

    public class PlanetGraphics
    {
        public PlanetGraphics(Coordinates coordinates)
        {
            this.m_Coordinates = coordinates;
        }

        public Coordinates m_Coordinates;
        public List<Planet> m_Neighbors;
    }
}